package org.truenewx.tnxjeex.unit.model;

import javax.measure.quantity.Length;

import org.truenewx.tnxjee.core.caption.Caption;
import org.truenewx.tnxjee.core.enums.annotation.SimpleEnumType;
import org.truenewx.tnxjeex.unit.support.MeasureUnits;
import org.truenewx.tnxjeex.unit.util.UnitTypes;
import tech.units.indriya.unit.Units;

/**
 * 长度单位
 */
@Caption("长度单位")
@SimpleEnumType(name = UnitTypes.LENGTH)
public interface LengthUnit extends MeasureUnit<Length> {

    @Caption("千米")
    LengthUnit KILOMETER = MeasureUnits.getInstance()
            .multiply(Units.METRE, 1000, LengthUnit.class, "km", "KILOMETER", "LKM");

    @Caption("米")
    LengthUnit METER = MeasureUnits.getInstance().add(Units.METRE, LengthUnit.class, null, "METER", "LM");

    @Caption("分米")
    LengthUnit DECIMETER = MeasureUnits.getInstance().divide(METER, 10, "dm", "DECIMETER", "LDM");

    @Caption("厘米")
    LengthUnit CENTIMETER = MeasureUnits.getInstance().divide(METER, 100, "cm", "CENTIMETER", "LCM");

    @Caption("毫米")
    LengthUnit MILLIMETER = MeasureUnits.getInstance().divide(METER, 1000, "mm", "MILLIMETER", "LMM");

    @Caption("微米")
    LengthUnit MICROMETER = MeasureUnits.getInstance().divide(MILLIMETER, 1000, "um", "MICROMETER", "LUM");

    @Caption("纳米")
    LengthUnit NANOMETER = MeasureUnits.getInstance().divide(MICROMETER, 1000, "nm", "NANOMETER", "LNM");

}
